package org.weso.acota.to.feedback;

import java.util.LinkedList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

@XmlRootElement(name = "feedbackUser")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "feedbackUser", propOrder = {
	"id",
    "name",
    "interests"
})
public class FeedbackUser {
	private String id;
	private String name;
	private List<FeedbackResource> interests;
	
	public FeedbackUser(){
		super();
		name = "";
		interests = new LinkedList<FeedbackResource>();
	}
	public FeedbackUser(String name, List<FeedbackResource> interests) {
		super();
		this.name = name;
		if(interests == null){
			this.interests = new LinkedList<FeedbackResource>();
		}else{
			this.interests = interests;
		}
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public List<FeedbackResource> getInterests() {
		return interests;
	}
	public void setInterests(List<FeedbackResource> interests) {
		this.interests = interests;
	}
	
	public void setId(String id) {
		this.id = id;
	}
	public String getId() {
		return id;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		FeedbackUser other = (FeedbackUser) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}
	
	
}
